package facade;

/**
 * @Author liangliangzhao
 * @data 2023/4/14 11:31
 */

public class HomeTheaterFacade {
    // 定义各个子系统对象
    private TheaterLight theaterLight;//灯光
    private Popcorn popcorn;//爆米花机
    private Stereo stereo;//立体声
    private Projector projector;//投影仪
    private Screen screen;//屏幕
    private DVDPlayer dvdPlayer;//播放
    public HomeTheaterFacade() {
        super();
        this.theaterLight = TheaterLight.getInstance();
        this.popcorn = Popcorn.getInstance();
        this.stereo = Stereo.getInstance();
        this.projector = Projector.getInstance();
        this.screen = Screen.getInstance();
        this.dvdPlayer = DVDPlayer.getInstance();
    }
    public void ready(){
        popcorn.on();
        popcorn.pop();
        screen.down();
        projector.on();
        stereo.on();
        dvdPlayer.on();
        theaterLight.dim();
    }
    public void play(){
        dvdPlayer.play();
    }
    public void pause(){
        dvdPlayer.pause();
    }
    public void end(){
        popcorn.off();
        theaterLight.bright();
        screen.up();
        projector.off();
        stereo.off();
        dvdPlayer.off();
    }
}
